<template>
  <el-table :data="tableData" stripe style="width: 100%">
    <el-table-column prop="id" label="Id" width="180" />
    <el-table-column prop="name" label="姓名" width="180" />
    <el-table-column prop="phonenumber" label="电话号" />
    <el-table-column prop="age" label="年龄"/>
    <el-table-column prop="classId" label="班级"/>
    <el-table-column prop="gender" label="性别"/>
  </el-table>
</template>
<script>
import axios from "axios"
export default {
  data() {
    return {
      tableData: [{
        id: "",
        name: "",
        age:"",
        classId:"",
        phonenumber: "",
        gender:""
      },
      ]
    }
  },
  mounted() {
    axios.post("/api/student/selectAll")
      .then(res => {
        console.log("获取成功", res.data);
        this.tableData = res.data;
      })
      .catch(error => {
        console.error("发送失败", error);
      })
  }
}

</script>